package com.lange.fileManagement.controller;

import com.alibaba.fastjson.JSONObject;
import com.lange.fileManagement.service.BaseService;
import com.lange.fileManagement.service.UserService;
import com.lange.fileManagement.utils.AESUtil;
import com.lange.fileManagement.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/base")
public class BaseController {
    @Autowired
    private BaseService baseService;

    @Autowired
    private UserService userService;

    /*测试请求*/
    @GetMapping("/test")
    public Result test() {
        return Result.success("ok");
    }

    /*根据动态表名获取表的全部数据*/
    @GetMapping("/getByTableName")
    public Result getByTName(@RequestParam String tableName) {
        return Result.success(baseService.getAllByTableName(tableName));
    }
}
